<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2016/9/9
 * Time: 15:35
 */
if (!defined('ACCESS')) {
    exit('Access denied.');
}

class AdminKd extends Base
{

    private static $table_name = 'yg_kd';
    // 查询字段
    private static $columns = array('id', 'kd_name', 'kd_url', 'order_sn', 'kd_sn', 'isGo', 'pz_days', 'createtime', 'modifytime');

    public static function getTableName()
    {
        return self::$table_name;
    }


    public static function getKdInfoBySn($sn)
    {
        $condition = array('order_sn' => $sn);
        $db = self::__instance();
        $rt = $db->get(self::getTableName(), self::$columns, $condition);
        return $rt;
    }

    public static function update($sn, $data)
    {
        $condition = array('order_sn' => $sn);
        $db = self::__instance();
        $rt = $db->update(self::getTableName(), $data, $condition);
        return $rt;
    }

    public static function add($data)
    {
        $db = self::__instance();
        $rt = $db->insert(self::getTableName(), $data);
        return $rt;
    }
}




